package com.xiaotu.service;

import com.xiaotu.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;
@FeignClient(value = "springcloud-provide-dept",fallbackFactory = DeptClientHystrixService.class)
@Component
public interface DeptClientService {
    @GetMapping("/dept/{id}")
    public Dept queryById(@PathVariable Integer id);
    @GetMapping("/dept")
    public List<Dept> queryAll();
    @PostMapping("/dept")
    public Boolean addDept(Dept dept);
}
